﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using RemoteTestRunner.Contracts;

namespace RemoteTestRunner.FormsUI.Wpf
{
    public class ResultImageSourceConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            TestResultInfo typedValue = value as TestResultInfo;
            if (typedValue != null)
            {
                if (typedValue.Passed)
                {
                    return "images/passed.bmp";
                }
                {
                    return "images/failed.bmp";
                }
            }
            else
            {
                return string.Empty;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
